home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.cyberramp.net!news
- From: sinan@cyberramp.net (John L. Noland)
- Newsgroups: comp.lang.c
- Subject: Re: PUBLIC / PRIVATE
- Date: 18 Apr 1996 23:05:09 GMT
- Organization: Uno mas por favor
- Message-ID: <4l6hr5$t5o@newshost.cyberramp.net>
- References: <4l3k8d$hkp@mulga.cs.mu.OZ.AU>
- NNTP-Posting-Host: ramp1-6.cyberramp.net
- X-Newsreader: WinVN 0.99.5
-
- In article <4l3k8d$hkp@mulga.cs.mu.OZ.AU>, simc@mundil.cs.mu.OZ.AU says...
- >
- >I'm analysing some C source code and I've
- >come across PUBLIC and PRIVATE keywords
-
- >I though C didn't have PUBLIC or PRIVATE ?
- >It definitely doesn't look like C++ source code - it looks like
- >C code with PUBLIC and PRIVATE keywords scattered everywhere.
-
- A common C coding style is to give macros names in all caps.
- This looks like the case here. I've seen this before. Usually, you'll
- have something like this in a header file:
-
- #ifdef DEBUG
- #define PRIVATE
- #else
- #define PRIVATE static
- #endif
- #define PUBLIC
-
- The first definition of PRIVATE expands to an empty string. This
- lets you put normally invisible variables and subroutines into the
- link map. That way you can find them when you're debugging. Then
- when you're done debugging their scope is limited to the current
- file. PUBLIC doesn't do anything. It's usually provided for documentation
- purposes only.
-
-
- >2nd question:
- > PRIVATE void HTFWriter_write ARGS3(HTSteam, *, me, CONST char*,
- > s, int, l) { fwrite(s, 1, l, me->fp) }
- >
- > What is the ARGS3 ?
- > I'm accustomed to
- > return_type function_name(args) { ... }
- >
-
- It's probably a macro also, though I'm not sure what it does. Look
- in the #include files for this file. You'll probably find #define's
- for these in one of them.
-
- -John
-
-